const express = require("express")
const app = express()

app.set('view engine', 'ejs')
app.use(express.static("public"))
app.use(express.urlencoded({ extended: true}))
app.use(express.json())
// app.use(logger)

app.get("/index", logger, logger, logger, (req, res) => {
    res.render("index", {text:"1111"})
})

const userRouter = require('./routes/users')

app.use("/users", userRouter)

function logger(req, res, next){
    console.log(req.originalUrl)
    next()
}

app.listen(3000)